package org.github.manx98.jlibhac.common;

/**
 * @author Manx98
 * @version 1.0
 * @since 2022/10/4 21:37
 */
public class StackTraceUtil {
    public static String getStackTrace() {
        StackTraceElement[] stack = Thread.currentThread().getStackTrace();
        StringBuffer buffer = new StringBuffer().append("\n-------------------------------------------------\n");
        for (StackTraceElement stackTraceElement : stack) {
            buffer.append(stackTraceElement.getClassName()).append(" 。").append(stackTraceElement.getMethodName()).append("\n");
        }
        buffer.append("\n----------------------------------------\n");
        return buffer.toString();
    }
}
